#ifndef __NODE__
#define __NODE__
#include "Thread.h"
#include "BoundedMailBox.h"


class Node:public Thread
{

private:
		
	BoundedMailBox* message_queue;
	int ID;
	int _size;
	RT* RTs_array;
	RT* current_RT;
	int* neighbours_list;
	static void* update(void* arg);
	int junk;
	bool inserting;	
	
public:
	Node(int id, int mailboxsize, int size, int* neighbours);
	~Node();	
	int send(int dest, Message* m);
	int getMailBoxSize();
	int getMailBoxMaxSize();
	bool getIsInserting();
	BoundedMailBox* getMailBox();
	void process(Message* m);
	int getsize();
	int getID();
	RT* get_current_RT();
	RT get_RTs_array(int index);
	void kill_RTs_array(int index);
	int get_neighbours_list(int i);
	
};
#endif



